package com.visionet.waveletData.web.vo.business;

import java.util.Date;
import java.util.List;

import org.springside.modules.utils.Collections3;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.visionet.waveletData.web.common.utils.RegxUtil;
import com.visionet.waveletData.web.entity.JsonDateSerializer;
import com.visionet.waveletData.web.vo.BaseVo;


public class AnswerVo extends BaseVo {

	private Long questionId; //问题id
	private String answerText;//回答文本
	private String answerHtml;
	private String userName;
	private Long userId; //回答问题者的id
	private Long parentId;//引用回答问题id
	private Date createDate;
	private Date deleteDate;
	private Integer delFlag;
	private Long orgId;
	private Integer praiseCount;//点赞的总数
	private Integer isSolution;//是否已解决问题
	private Long mentionId;//点赞的id
	private String userImgUrl;
    private String picture = "";
	
	public Long getMentionId() {
		return mentionId;
	}
	public void setMentionId(Long mentionId) {
		this.mentionId = mentionId;
	}
	public Integer getPraiseCount() {
		return praiseCount;
	}
	public void setPraiseCount(Integer praiseCount) {
		this.praiseCount = praiseCount;
	}
	public Long getQuestionId() {
		return questionId;
	}
	public void setQuestionId(Long questionId) {
		this.questionId = questionId;
	}
	public String getAnswerText() {
		return answerText;
	}
	public void setAnswerText(String answerText) {
		this.answerText = answerText;
	}
	public String getAnswerHtml() {
		return answerHtml;
	}
	public void setAnswerHtml(String answerHtml) {
		this.answerHtml = answerHtml;
        if(answerHtml!=null){
            List<String> list = RegxUtil.getImgStr(answerHtml);
            if(!Collections3.isEmpty(list)){
                this.picture = list.get(0);
            }
        }
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getDeleteDate() {
		return deleteDate;
	}
	public void setDeleteDate(Date deleteDate) {
		this.deleteDate = deleteDate;
	}
	public Integer getDelFlag() {
		return delFlag;
	}
	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}
	public Long getOrgId() {
		return orgId;
	}
	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}
	
	public Integer getIsSolution() {
		return isSolution;
	}
	public void setIsSolution(Integer isSolution) {
		this.isSolution = isSolution;
	}
	public String getUserImgUrl() {
		return userImgUrl;
	}
	public void setUserImgUrl(String userImgUrl) {
		this.userImgUrl = userImgUrl;
	}

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

}
